﻿using System;
using System.Collections.Generic;
using System.Web;

using OctoOS;
using OctoOS.UI;

public partial class samples_form : OOSPage
{
	protected void Page_Load(object sender, EventArgs e)
	{
		AddBreadcrumb("", Urls.GetHome());
		AddBreadcrumb("Samples", Urls.Samples.GetHome());
	}

	protected void ValidateEMailAddresses(object sender, ValidateEventArgs e)
	{
		if(eMail.Text != eMail2.Text)
			e.ErrorMessage = "The e-mail fields are not equal.";
	}

	protected void ValidateTOSAgreement(object sender, ValidateEventArgs e)
	{
		if(!tos.Checked)
			e.ErrorMessage = "In order to submit the form you must agree with TOS.";
	}

	protected void btn_Clicked(object src, EventArgs e)
	{
		if(IsValid)
		{
			myForm.Visible = false;
			resultMsg.Text = "The form has been submitted.";
		}
	}
}